<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
<style>
#top {
	width: 400px;
	height: auto;
	position: relative;
	margin-left: auto;
	margin-right: auto;/*border:#000000 groove 1px;*/
}
#day, #hour, #min, #hmao {
	display: inline-block;
	width: 75px;
	height: 24px;
	position: inherit;
	float: left;
	border: 1px groove #7A7A7A;
	text-decoration: none;
	border-radius: 10px;
	list-style: none;/*padding: 2px 10px 2px 10px;*/
}
p {
	color: red;
	margin-top: auto;
	margin-bottom: auto;
	text-align: center;/*	padding: 4px 0px;*/
}
h3 {
	text-align: center;
}
	h6{clear:both;
		text-align: center;
	}
</style>
</head>
<body>
<div id="top">
  <h3>距离2022年6月1号还有：</h3>
  <div id="day"></div>
  <div id="hour"></div>
  <div id="min"></div>
  <div id="hmao"></div>
  <h6>只要我刷新得快，那我就是在倒计时</h6>
</div>
</body>
<script>
	(function(){
		var start_time =new Date(2022,05,01,00,00,00);
	
		console.log(start_time);
		var end_time =Date.now();
		console.log(end_time);
		
		var etime=start_time-end_time;
		
		
		console.log(etime);
		var d=parseInt(etime/86400000);
		console.log(d);
		var h=parseInt(etime/3600000-d*24);
		var h_=parseInt(etime/3600000);
		
			var m=parseInt(etime/60000-h_*60);
				var hm=parseInt(etime/1000-d*86400-h*3600-m*60);
		
		console.log(h);
		console.log(m);
		console.log(hm);
		var f,d,h,h_,m,hm,etime;
		
		day.innerHTML="<p>"+"日："+d+"</p>";	
		hour.innerHTML="<p>"+"小时："+h+"</p>";	
		min.innerHTML="<p>"+"分钟："+m+"</p>";	
		hmao.innerHTML="<p>"+"秒："+hm+"</p>";	
		;})();
			
	 var sid =setInterval(echoStr,1000);
	function echoStr(){
		/*alert("JavaScript,我的网页");*/
		location.reload();
	}
	


	</script>
</html>
